﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="UploadTemplate.aspx.cs" Inherits="Whir_System_Module_Template_UploadTemplate" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>上传模板</title>
    <link href="../../Skin/Default/Css/main.css" rel="stylesheet" type="text/css" />
    <base target="_self" />
</head>
<body scroll="no">
    <form id="form1" runat="server">
        <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#DADADA">
            <tr>
                <td height="26" align="left" class="form_title"><strong>上传模板</strong></td>
            </tr>
            <tr>
                <td height="30" align="left" class="form_tdText">&nbsp;<asp:FileUpload ID="myFile"
                    runat="server" />
                </td>
            </tr>
            <tr>
                <td height="30" align="center" class="form_tdText">
                    <asp:Button ID="btnSubmit" runat="server" Text="确定" CssClass="btn_default" OnClick="btnSubmit_Click"
                        OnClientClick="return checkForm();" />
                </td>
            </tr>
        </table>
        <asp:HiddenField ID="hfDir" runat="server" />
    </form>
</body>
</html>

<script language="javascript">
document.getElementById("hfDir").value = window.dialogArguments;

function checkForm()
{
    var v = document.getElementById("myFile").value;

    if(v == "")
    {
        alert("请选择文件(htm、html)!");
        return false;
    }
    else
    {
        var vs = v.split('.');
        var v2 = vs[vs.length-1].toLowerCase();
        if(v2 != "htm" && v2 != "html")
        {
            alert("请选择正确的文件(htm、html)!");
            return false;
        }
    }
    
    return true;
}
</script>

<script language="javascript" src="../../Js/common.js"></script>

<script type="text/javascript">initAutoFormStyle();</script>